package com.item.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author liuyuanyuan on 2023/12/6
 */
@Configuration
public class SpringMvcSupport extends WebMvcConfigurationSupport {
    /**
     * 资源处理
     * @param registry
     */
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {

        registry
                //当访问 /views/** 这个路径 我们让它 访问资源路径 /views/
                .addResourceHandler("/views/**")
                .addResourceLocations("/views/")
        ;

        super.addResourceHandlers(registry);
    }
}
